package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_train_det", schema = "test", catalog = "")
public class TrainDet {
    private int trainId;
    private int stuId;

    @Id
    @Column(name = "train_id", nullable = false)
    public int getTrainId() {
        return trainId;
    }

    public void setTrainId(int trainId) {
        this.trainId = trainId;
    }

    @Basic
    @Column(name = "stu_id", nullable = false)
    public int getStuId() {
        return stuId;
    }

    public void setStuId(int stuId) {
        this.stuId = stuId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TrainDet trainDet = (TrainDet) o;

        if (trainId != trainDet.trainId) return false;
        if (stuId != trainDet.stuId) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = trainId;
        result = 31 * result + stuId;
        return result;
    }
}
